package com.origin.netlibrary.download.bean;

import android.util.Log;

import com.origin.netlibrary.download.DownLoadService;

import org.greenrobot.greendao.annotation.Entity;

import java.io.File;

import org.greenrobot.greendao.annotation.Generated;

@Entity
public class DownloadInfoDao {


    /* 存储位置 */
    private String savePath;
    /* 文件总长度 */
    private long contentLength;
    /* 下载长度 */
    private long readLength;
    /* 下载该文件的url */
    private String url;

    public boolean  isDownComplete(){
        return  contentLength==readLength;
    }

    @Generated(hash = 758664431)
    public DownloadInfoDao(String savePath, long contentLength, long readLength,
                           String url) {
        this.savePath = savePath;
        this.contentLength = contentLength;
        this.readLength = readLength;
        this.url = url;
    }

    @Generated(hash = 814722664)
    public DownloadInfoDao() {
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getSavePath() {
        return savePath;
    }

    public void setSavePath(String savePath) {
        this.savePath = savePath;
    }

    public long getContentLength() {
        return contentLength;
    }

    public void setContentLength(long contentLength) {
        this.contentLength = contentLength;
    }

    public long getReadLength() {
        return readLength;
    }

    public void setReadLength(long readLength) {
        this.readLength = readLength;
    }


    @Override
    public String toString() {
        return "DownloadInfo{" +
                "savePath='" + savePath + '\'' +
                ", contentLength=" + contentLength +
                ", readLength=" + readLength +
                ", url='" + url + '\'' +
                '}';
    }
}